build: Support BL-specific build flags
authorJeenu Viswambharan <jeenu.viswambharan@arm.com>
Thu, 1 Nov 2018 10:55:55 +0000 (10:55 +0000)
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>
Thu, 10 Jan 2019 13:50:02 +0000 (13:50 +0000)
With this patch, each BL image can have its own compiler flags.

Change-Id: Ic9075a20bc6f6dc8a277587b9bee5e062306c090
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
make_helpers/build_macros.mk

index d60a5bf0ee8dc9d1629f197922d213e6f081e2f7..961cabfeeea807c331b67dade52b1045c0a9c730 100644 (file)
@@ -216,10 +216,11 @@ define MAKE_C
 $(eval OBJ := $(1)/$(patsubst %.c,%.o,$(notdir $(2))))
 $(eval DEP := $(patsubst %.o,%.d,$(OBJ)))
 $(eval IMAGE := IMAGE_BL$(call uppercase,$(3)))
+$(eval BL_CFLAGS := $(BL$(call uppercase,$(3))_CFLAGS))
 
 $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | bl$(3)_dirs
        $$(ECHO) "  CC      $$<"
-       $$(Q)$$(CC) $$(TF_CFLAGS) $$(CFLAGS) -D$(IMAGE) $(MAKE_DEP) -c $$< -o $$@
+       $$(Q)$$(CC) $$(TF_CFLAGS) $$(CFLAGS) $(BL_CFLAGS) -D$(IMAGE) $(MAKE_DEP) -c $$< -o $$@
 
 -include $(DEP)